/*
 * client.cpp
 *
 *  Created on: Apr 21, 2011
 *      Author: RKoh
 */

#include <stdio.h>
#include "ngine/ngine.h"

int main()
{
	printf("Starting..\n");
	NGineClient::init("localhost", 5000, 0);
//	NGineClient::init("suk-ho.net", 5000, 0);
//	NGineClient::init("24.99.88.82", 5000, 0);
	printf("Started\n\n");

	NGineClient::sendToServer(1, "hello1");
	NGineClient::sendToServer(1, "hello2");
	NGineClient::sendToServer(1, "hello3");
	NGineClient::sendToServer(1, "hello4");
	NGineClient::sendToServer(1, "hello5");

	while(1)
	{
		if(NGineClient::getQueueSize() > 0)
		{
			printf("buffer ain't empty\n");
			NGMessage *recvMsg = NGineClient::getFirstMessage();
			printf("msg->data: %s\n\n", recvMsg->getData());

			delete recvMsg;
		}
	}


	return 0;
}
